package thread.state;

/**
 * @program: Multhread
 * @description: 等待状态
 * @author: zhanghz001
 * @create: 2021-03-04 15:24
 **/
public class WaitingState {
    public static void main(String[] args) throws InterruptedException {
        byte[] lock = new byte[0];
        Thread t1 = new Thread(() -> {
            try {
                synchronized (lock) {
                    lock.wait();
                }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        t1.start();
        Thread.sleep(10);
        System.out.println(t1.getState());
        
    }
}
